import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;


public class CoordJUnit {

	private CoordFinder coordFind;
	
	@Before
	public void setup(){
		coordFind = new CoordFinder();
	}
	

	@Test
	public void testSanDimas() {
		assertEquals("San Dimas, CA, USA", coordFind.getAddress("San Dimas"));
	}
	
	@Test
	public void testHonolulu(){
		assertEquals("Honolulu, HI, USA", coordFind.getAddress("Honolulu"));
	}
	
	@Test
	public void testLostSprings(){
		assertEquals("Lost Springs, WY, USA", coordFind.getAddress("Lost Springs"));
	}

	@Test
	public void testEurope(){
		assertEquals("Harstad, Norway", coordFind.getAddress("Harstad"));
	}
	
	@Test
	public void testJapan(){
		assertEquals("Tokyo, Japan", coordFind.getAddress("Tokyo"));
	}
	
	@Test
	public void testBadSpelling(){
		assertEquals("Los Angeles, CA, USA", coordFind.getAddress("Las Angelas"));
	}
	
	@Test
	public void testLaxLong(){
		assertEquals(-118.4, coordFind.getLongitude("LAX"), .2);
	}
	
	@Test
	public void testLaxLat(){
		assertEquals(33.9, coordFind.getLatitude("LAX"), .2);
	}
	
	@Test
	public void testStockholmLong(){
		assertEquals(18.1, coordFind.getLongitude("Stockholm"), .2);
	}
	
	@Test
	public void testStockholmLat(){
		assertEquals(59.3, coordFind.getLatitude("Stockholm"), .2);
	}
	
	@Test
	public void testRioLong(){
		assertEquals(-43.2, coordFind.getLongitude("Rio de Janeiro"), .2);
	}
	
	@Test
	public void testRioLat(){
		assertEquals(-22.9, coordFind.getLatitude("Rio de Janeiro"), .2);
	}
	
	@Test
	public void testAucklandLong(){
		assertEquals(174.7, coordFind.getLongitude("Auckland"), .2);
	}
	
	@Test
	public void testAucklandLat(){
		assertEquals(-36.8, coordFind.getLatitude("Auckland"), .2);
	}
	
	@Test
	public void testUHLong(){
		assertEquals(-157.8, coordFind.getLongitude("UH Manoa"), .2);
	}
	
	@Test
	public void testUHLat(){
		assertEquals(21.3, coordFind.getLatitude("UH Manoa"), .2);
	}
	
	@Test
	public void testReykjavikLong(){
		assertEquals(-21.9, coordFind.getLongitude("Reykjavik"), .2);
	}
	
	@Test
	public void testReykjavikLat(){
		assertEquals(64.1, coordFind.getLatitude("Reykjavik"), .2);
	}
}
